package com.sunxd.vue.domain.bean.assembler;

import com.sunxd.vue.bean.request.ActivityConfigRequest;
import com.sunxd.vue.bean.request.InteractiveActivityRequest;
import com.sunxd.vue.bean.response.ActivityConfigInfo;
import com.sunxd.vue.bean.response.InteractiveActivityInfo;
import com.sunxd.vue.domain.bean.domain.interactive.ActivityConfig;
import com.sunxd.vue.domain.bean.domain.interactive.InteractiveActivity;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.Named;
import org.mapstruct.ReportingPolicy;

import static org.mapstruct.factory.Mappers.getMapper;

/**
 * @author sun.xd
 * @description: description
 * @date 2024/4/25 12:15
 */
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface InteractiveActivityAssembler {

    InteractiveActivityAssembler CONVERTER = getMapper(InteractiveActivityAssembler.class);

    @Mappings({
            @Mapping(target = "actConfig", source = "actConfig" ,qualifiedByName = "configReq2do"),
    })
    InteractiveActivity req2do(InteractiveActivityRequest param);

    @Mappings({
            @Mapping(target = "actConfig", source = "actConfig",qualifiedByName = "configdo2info"),
    })
    InteractiveActivityInfo do2info(InteractiveActivity param);


    @Named("configReq2do")
    ActivityConfig configReq2do(ActivityConfigRequest param);
    @Named("configdo2info")
    ActivityConfigInfo configdo2info(ActivityConfig param);

}
